package com.example.fengsam.myapplication;

import android.app.Activity;

import android.content.Intent;
import android.os.Bundle;

import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;


public class MainActivity extends Activity {
//    @ViewInject(R.id.btn_message_test)
//    Button mBtnMessageTesting;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);
        ViewUtils.inject(this);

//        mBtnMessageTesting=(Button)this.findViewById(R.id.btn_message_test);
//        mBtnMessageTesting.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Intent intent =new Intent(MainActivity.this,MessageActivity.class);
//                startActivity(intent);
//
//            }
//        });

    }

        @OnClick({R.id.btn_message_test,R.id.btn_ainiyo,R.id.btn_showingToast})
        public void onClick(View v)
        {
            switch (v.getId())
            {
                case R.id.btn_message_test:
                    Intent intent1 =new Intent(MainActivity.this,MessageActivity.class);
                    startActivity(intent1);
                    break;
                case R.id.btn_ainiyo:
                    Intent intent2 =new Intent(MainActivity.this,AiniyoActivity.class);
                    startActivity(intent2);
                    break;
                case R.id.btn_showingToast:
                    Intent intent3 =new Intent(MainActivity.this,TosatActivity.class);
                    startActivity(intent3);
                    break;
            }
        }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

}
